<?php
/**
 * Created by PhpStorm.
 * User: 小灰灰
 * Date: 2023-10-20
 * Time: 16:15:42
 * Info:
 */

namespace plugin\huiblog\app\middleware;

use Webman\Http\Request;
use Webman\Http\Response;
use Webman\MiddlewareInterface;

class MiddlewareA implements MiddlewareInterface
{

    public function process(Request $request, callable $handler): Response
    {
        $info = get_plugin_config(request()->plugin);
        if (empty($info['status'])) {
            return response("博客未启用，如需开启，请到后台插件管理中开启");
        }

        return $handler($request);
    }
}
